﻿<UserControl x:Class="GrooveSharp.ConfigurationFolders"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="500" >

    <UserControl.Resources>
        <ResourceDictionary Source="..\Resources\GlassButton.xaml"/>
    </UserControl.Resources>

    <GroupBox Header="Folders" >
        <StackPanel Orientation="Vertical" >
            <TextBlock Padding="5" Background="OrangeRed"  Foreground="Black" HorizontalAlignment="Left" MaxWidth="500" TextWrapping="WrapWithOverflow" FontWeight="Bold">
                        
                        Below an overview of folders containing albums. Add here for example:
                        <LineBreak/>
                        C:\Users\Peter\Music
                        
                        <LineBreak/><LineBreak/>
                        Do not add albums themselves, 
                        but add the folder above such that all contained albums will be added automatically.
                        
                        <LineBreak/><LineBreak/>
                        Already added folders, where tracks are found, can normally not be deleted anymore. 
                        Instead of deleting folders can be made inactive.
                        They are then not shown in the collection (but can be re-activated easily).

            </TextBlock>
            <ListView Name="theListView">

                <ListView.ItemContainerStyle>
                    <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource GrooveSharpListViewItem}" />
                </ListView.ItemContainerStyle>


                <ListView.View>
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn Header="Active" Width="40" >
                                <GridViewColumn.CellTemplate >
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding Active}"></CheckBox>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>

                            <GridViewColumn Header="Folder" Width="200"  DisplayMemberBinding="{Binding Path}" />

                            <GridViewColumn Header="Number of tracks" Width="100" DisplayMemberBinding="{Binding Count}" />

                            <GridViewColumn Header="Browse" Width="50"  >
                                <GridViewColumn.CellTemplate >
                                    <DataTemplate>
                                        <Button Tag="{Binding Id}" IsEnabled="{Binding Empty}" Name="buttonBrowsePath" Click="buttonBrowsePath_Click">...</Button>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>

            <StackPanel Background="Black" Orientation="Horizontal" Name="topStack">

                <Button Name="buttonAdd" Style="{StaticResource GlassButtonMedium}" Click="buttonAdd_Click" ToolTip="Add a folder containing albums">
                    <Image Source="../Images/plus.png" Style="{StaticResource ImageForMedium}"  />
                </Button>
                <Button Name="buttonRemove" Style="{StaticResource GlassButtonMedium}" Click="buttonRemove_Click" ToolTip="Remove an empty (unused) folder">
                    <Image Source="../Images/minus.png" Style="{StaticResource ImageForMedium}"  />
                </Button>
                <Button Name="buttonRefresh" Style="{StaticResource GlassButtonMedium}" Click="buttonRefresh_Click" ToolTip="Refresh contents">
                    <Image Source="../Images/refresh.png" Style="{StaticResource ImageForMedium}"  />
                </Button>
                <TextBlock Name="textBlockDebug" Foreground="Red" Padding="10,2,0,0" Visibility="Collapsed">Debug</TextBlock>
            </StackPanel>

        </StackPanel>

    </GroupBox>
</UserControl>
